﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
using System.IO;

namespace SilverlightOracle.Web
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService" in both code and config file together.
    [ServiceContract]
    public interface IService
    {
        [OperationContract]
        List<truong> GetTruong();
        [OperationContract]
        List<thisinh> SreachThiSinh(string MATRUONG, string MASV, string HOTEN);
        [OperationContract]
        List<nguoidung> ShowNguoiDung(int MATAIKHOAN, string TENTAIKHOAN, string QUYEN);
        [OperationContract]
        bool UpdateNguoiDung(nguoidung user, string QUYEN);
        [OperationContract]
        bool InsertNguoiDung(int MATAIKHOAN, string TENTAIKHOAN, string MATKHAU, string QUYENTRUYCAP, string EMAIL);
        [OperationContract]
        List<detailtruong> ShowTruong(string MATRUONG, string TENTRUONG, int MANGUOIDUNG);
        [OperationContract]
        bool UpdateTruong(detailtruong school, string MANGUOIDUNG);
        [OperationContract]
        string InsertTruong(string MATRUONG, string TENTRUONG, string DIENTHOAI, string EMAIL, string MANGUOIDUNG);
        [OperationContract]
        List<detailthisinh> ShowThiSinh();
        [OperationContract]
        string GetNguoiDungSession(string TAIKHOAN, string MATKHAU);
        [OperationContract]
        object GetSessionValue();
        [OperationContract]
        void SetSessionValue(string sessionKey);
        [OperationContract]
        List<nguoidung> ShowAllNguoiDung();
        [OperationContract]
        List<detailtruong> ShowAllTruong();
        [OperationContract]
        string InsertThiSinh(string MASV, string HOTEN, double MON1, double MON2, double MON3, double DIEMUUTIEN, int MANGANH, string DIACHI, long CMT, long DIENTHOAI, DateTime NGAYSINH, int MANGUOIDUNG, string MATRUONG);
        [OperationContract]
        List<Error> insertThiSinhpro(string[] MASV, string[] HOTEN, double[] MON1, double[] MON2, double[] MON3, double[] DIEMUUTIEN, int[] MANGANH, string[] DIACHI, long[] CMT, long[] DIENTHOAI, DateTime[] NGAYSINH, int MANGUOIDUNG, string[] MATRUONG, long row);
        [OperationContract]
        List<Error> insertPro(string data, int MANGUOIDUNG);
        [OperationContract]
        object GetSessionTruongValue();
        [OperationContract]
        void SetSessionTruongValue(int sessionKey);
        [OperationContract]
        bool UpdateThiSinh(detailthisinh dthisinh, string MANGUOIDUNG, DateTime date);
        [OperationContract]
        List<detailthisinh> SearchDetailThiSinh(string MATRUONG, string MASV, string HOTEN, long CMT);
        [OperationContract]
        List<quyen> GetQuyen();
        [OperationContract]
        int GetQuyenTruyCap(int ID);
        [OperationContract]
        bool CheckIdTruong(string MATRUONG);
        [OperationContract]
        bool CheckThiSinh(string MATHISINH);
        [OperationContract]
        List<detailtruong> ShowLichSuTruong(string MATRUONG);
        [OperationContract]
        List<detailthisinh> ShowLichSuThiSinh(string MASV);
        [OperationContract]
        int AutoIncrementID();
        [OperationContract]
        bool CheckNguoiDung(string TAIKHOAN);
    }
    [DataContract]
    public class thisinh
    {
        // public long _thisinh_id;
        public string _masv;
        public double _mon1;
        public double _mon2;
        public double _mon3;
        public double _diemuutien;
        public string _hoten;
        public string _ngaysinh;
        public string _truong;
        [DataMember]
        public string MASV
        {
            get { return _masv; }
            set { _masv = value; }
        }
        [DataMember]
        public double MON1
        {
            get { return _mon1; }
            set { _mon1 = value; }
        }
        [DataMember]
        public double MON2
        {
            get { return _mon2; }
            set { _mon2 = value; }
        }

        [DataMember]
        public double MON3
        {
            get { return _mon3; }
            set { _mon3 = value; }
        }
        [DataMember]
        public double DIEMUUIEN
        {
            get { return _diemuutien; }
            set { _diemuutien = value; }
        }
        [DataMember]
        public string HOTEN
        {
            get { return _hoten; }
            set { _hoten = value; }
        }
        [DataMember]
        public string NGAYSINH
        {
            get { return _ngaysinh; }
            set { _ngaysinh = value; }
        }
        [DataMember]
        public string TRUONG
        {
            get { return _truong; }
            set { _truong = value; }
        }
    }
    [DataContract]
    public class truong
    {
        public string _matruong;
        public string _tentruong;
        [DataMember]
        public string MATRUONG
        {
            get { return _matruong; }
            set { _matruong = value; }
        }
        [DataMember]
        public string TENTRUONG
        {
            get { return _tentruong; }
            set { _tentruong = value; }
        }
    }
    [DataContract]
    public class nguoidung
    {
        public string _taikhoan;
        public string _matkhau;
        public int _manguoidung;
        public string _quyentruycap;
        public string _email;
        [DataMember]
        public string TAIKHOAN
        {
            get { return _taikhoan; }
            set { _taikhoan = value; }
        }
        [DataMember]
        public string MATKHAU
        {
            get { return _matkhau; }
            set { _matkhau = value; }
        }
        [DataMember]
        public int MANGUOIDUNG
        {
            get { return _manguoidung; }
            set { _manguoidung = value; }
        }
        [DataMember]
        public string QUYENTRUYCAP
        {
            get { return _quyentruycap; }
            set { _quyentruycap = value; }
        }
        [DataMember]
        public string EMAIL
        {
            get { return _email; }
            set { _email = value; }
        }
    }
    [DataContract]
    public class detailtruong
    {
        public string _matruong;
        public string _tentruong;
        public string _email;
        public string _dienthoai;
        public string _manguoidung;
        public DateTime _ngaycapnhat;
        public int _lancapnhat;
        [DataMember]
        public string MATRUONG
        {
            get { return _matruong; }
            set
            {
                _matruong = value;
            }
        }
        [DataMember]
        public string TENTRUONG
        {
            get { return _tentruong; }
            set { _tentruong = value; }
        }
        [DataMember]
        public string EMAIL
        {
            get { return _email; }
            set { _email = value; }
        }
        [DataMember]
        public string DIENTHOAI
        {
            get { return _dienthoai; }
            set { _dienthoai = value; }
        }
        [DataMember]
        public string MANGUOIDUNG
        {
            get { return _manguoidung; }
            set { _manguoidung = value; }
        }
        [DataMember]
        public DateTime NGAYCAPNHAT
        {
            get { return _ngaycapnhat; }
            set { _ngaycapnhat = value; }
        }
        [DataMember]
        public int LANCAPNHAT
        {
            get { return _lancapnhat; }
            set { _lancapnhat = value; }
        }

    }
    [DataContract]
    public class detailthisinh
    {
        // public long _thisinh_id;
        public string _masv;
        public double _mon1;
        public double _mon2;
        public double _mon3;
        public double _diemuutien;
        public string _hoten;
        public string _ngaysinh;
        public string _truong;
        public int _manganh;
        public string _diachi;
        public long _cmt;
        public long _dienthoai;
        public string _manguoidung;
        public DateTime _ngaycapnhat;
        public int _lancapnhat;
        public string _matruong;
        [DataMember]
        public string MASV
        {
            get { return _masv; }
            set { _masv = value; }
        }
        [DataMember]
        public double MON1
        {
            get { return _mon1; }
            set { _mon1 = value; }
        }
        [DataMember]
        public double MON2
        {
            get { return _mon2; }
            set { _mon2 = value; }
        }
        [DataMember]
        public double MON3
        {
            get { return _mon3; }
            set { _mon3 = value; }
        }
        [DataMember]
        public double DIEMUUIEN
        {
            get { return _diemuutien; }
            set { _diemuutien = value; }
        }
        [DataMember]
        public string HOTEN
        {
            get { return _hoten; }
            set { _hoten = value; }
        }
        [DataMember]
        public string NGAYSINH
        {
            get { return _ngaysinh; }
            set { _ngaysinh = value; }
        }
        [DataMember]
        public string TRUONG
        {
            get { return _truong; }
            set { _truong = value; }
        }
        [DataMember]
        public int MANGANH
        {
            get { return _manganh; }
            set { _manganh = value; }
        }
        [DataMember]
        public string DIACHI
        {
            get { return _diachi; }
            set { _diachi = value; }
        }
        [DataMember]
        public long CMT
        {
            get { return _cmt; }
            set { _cmt = value; }
        }
        [DataMember]
        public long DIENTHOAI
        {
            get { return _dienthoai; }
            set { _dienthoai = value; }
        }
        [DataMember]
        public string MANGUOIDUNG
        {
            get { return _manguoidung; }
            set { _manguoidung = value; }
        }
        [DataMember]
        public DateTime NGAYCAPNHAT
        {
            get { return _ngaycapnhat; }
            set { _ngaycapnhat = value; }
        }
        [DataMember]
        public int LANCAPNHAT
        {
            get { return _lancapnhat; }
            set { _lancapnhat = value; }
        }
        [DataMember]
        public string MATRUONG
        {
            get { return _matruong; }
            set { _matruong = value; }
        }
    }
    [DataContract]
    public class quyen
    {
        public string _maquyen;
        public string _tenquyen;
        [DataMember]
        public string MAQUYEN
        {
            get { return _maquyen; }
            set { _maquyen = value; }
        }
        [DataMember]
        public string TENQUYEN
        {
            get { return _tenquyen; }
            set { _tenquyen = value; }
        }
    }
    [DataContract]
    public class Error
    {
        public string _noidung;
        public string _maso;
        [DataMember]
        public string NOIDUNG
        {
            get { return _noidung; }
            set { _noidung = value; }
        }
        [DataMember]
        public string MASO
        {
            get { return _maso; }
            set { _maso = value; }
        }

    }


}
